import React ,{useState} from 'react';
import { Input,Button } from 'antd';
import { PlusOutlined } from '@ant-design/icons';

function Header(props) {
    const [value, setValue] = useState('')

    return (
        <div style={{ width: '50%',paddingBottom:'10px',display:'flex'}}>
            <Input placeholder="请输入选项" style={{height:50}} value={value} onChange={
                e => setValue(e.target.value)
            }/>
            <Button icon={<PlusOutlined />} type='primary' style={{height:50 ,marginLeft:10}}
              onClick={()=> {
                props.onSubmit(value)
                setValue('')
              }
            }>添加</Button>
        </div>
    );
}

export default Header;
